import Vue from 'vue'
import Vuex from 'vuex'

Vue.use(Vuex);

export default new Vuex.Store({
  state: {
    userType: '1',
    // userInfo: {"regaddress":"泰安市泰山区财源街道东七里社区上峰七里御府 17号楼2单元1702号","loginname":"zwfw3591927249","iid":"3510356","opscope":"计算机科技领域内的技术开发、技术咨询、技术服务、技术转让；计算机软件、办公用品、电子产品及配件的销售。（依法须经批准的项目，经相关部门批准后方可开展经营活动）","mobile":"15610370620","uuid":"CO202010281413331340011739613","corusercardid":"370921198707161598","regsource":"","lastlogintime":"","cortype":"1","linktel":"","corusername":"杨健","estdate":"","themes":"","corrole":"2","corusermobile":"15610370620","attorneypowerpath":"","enable":"1","cornumber":"91370902MA3N3Y3F4B","cardid":"370921198707161598","name":"杨健","corname":"泰安智兔网络科技有限公司","email":""}
    userInfo: {}
  },
  mutations: {
    setState(state, data) {
      const { key, value } = data;
      state[key] = value;
      let val = value;
      if (typeof (val) === 'object') {
        val = JSON.stringify(val)
      }
      sessionStorage.setItem(key, val);
    }
  },
  actions: {
  },
  modules: {
  }
})
